﻿Imports System.ComponentModel

Public Class AddinInfo
    Implements INotifyPropertyChanged

    ''' <summary>
    ''' Deaktivieren
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        Try
            Dim addin As IPlugIn2 = DataContext
            addin.Disable()
        Catch : End Try
    End Sub

    ''' <summary>
    ''' Aktivieren
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
        Try
            Dim addin As IPlugIn2 = DataContext
            addin.Initialize()
        Catch : End Try
    End Sub

    ''' <summary>
    ''' Grant rights
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub Button_Click_3(sender As Object, e As RoutedEventArgs)

    End Sub

    ''' <summary>
    ''' Deny Rights
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Private Sub Button_Click_4(sender As Object, e As RoutedEventArgs)

    End Sub

    Private Sub UserControl_DataContextChanged_1(sender As Object, e As DependencyPropertyChangedEventArgs)
        If DataContext IsNot Nothing Then
            sp_AddinInfo.Visibility = Windows.Visibility.Visible
            sp_noAddin.Visibility = Windows.Visibility.Collapsed
        Else
            sp_AddinInfo.Visibility = Windows.Visibility.Collapsed
            sp_noAddin.Visibility = Windows.Visibility.Visible
        End If
    End Sub

    Protected Sub NotifyPropertyChanged(info As [String])
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub

    Public Event PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
End Class
